package com.ruoyi.web.wh.service.impl;

import java.util.List;
import com.ruoyi.framework.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.wh.mapper.WhGoodsMapper;
import com.ruoyi.web.wh.domain.WhGoods;
import com.ruoyi.web.wh.service.IWhGoodsService;

/**
 * 物品Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-23
 */
@Service
public class WhGoodsServiceImpl implements IWhGoodsService {
    @Autowired
    private WhGoodsMapper whGoodsMapper;

    /**
     * 查询物品
     * 
     * @param id 物品主键
     * @return 物品
     */
    @Override
    public WhGoods selectWhGoodsById(Long id){
        return whGoodsMapper.selectWhGoodsById(id);
    }

    /**
     * 查询物品列表
     * 
     * @param whGoods 物品
     * @return 物品
     */
    @Override
    public List<WhGoods> selectWhGoodsList(WhGoods whGoods){
        return whGoodsMapper.selectWhGoodsList(whGoods);
    }

    /**
     * 新增物品
     * 
     * @param whGoods 物品
     * @return 结果
     */
    @Override
    public int insertWhGoods(WhGoods whGoods){
        whGoods.setCreateTime(DateUtils.getNowDate());
        return whGoodsMapper.insertWhGoods(whGoods);
    }

    /**
     * 修改物品
     * 
     * @param whGoods 物品
     * @return 结果
     */
    @Override
    public int updateWhGoods(WhGoods whGoods){
        whGoods.setUpdateTime(DateUtils.getNowDate());
        return whGoodsMapper.updateWhGoods(whGoods);
    }

    /**
     * 批量删除物品
     * 
     * @param ids 需要删除的物品主键
     * @return 结果
     */
    @Override
    public int deleteWhGoodsByIds(Long[] ids){
        return whGoodsMapper.deleteWhGoodsByIds(ids);
    }

    /**
     * 删除物品信息
     * 
     * @param id 物品主键
     * @return 结果
     */
    @Override
    public int deleteWhGoodsById(Long id){
        return whGoodsMapper.deleteWhGoodsById(id);
    }
}
